#include<bits/stdc++.h>
using namespace std;
int main()
{
	int h,m,s;
	long long n;
	cin >> n;
	n = n / 1000;
	n = n % (24*60*60);
	h = n / (60*60);
	n = n % (60*60);
	m = n / 60;
	s = n % 60;
	printf("%02d:%02d:%02d",h,m,s);
	return 0;
 } 
